.class final Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;
.super Lcom/burstly/lib/component/AbstractAdaptor;
.source "GreystripeAdaptor.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor$GSListener;
    }
.end annotation


# static fields
.field static final FULLSCREEN_INFO:Lcom/burstly/lib/component/IBurstlyAdaptorListener$FullscreenInfo; = null

.field static final NETWORK_NAME:Ljava/lang/String; = "greystripe"


# instance fields
.field private final mConfigurator:Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;

.field private final mListener:Lcom/greystripe/sdk/GSAdListener;

.field private mPrecachedInterstitial:Lcom/greystripe/sdk/GSFullscreenAd;


# direct methods
.method static constructor <clinit>()V
    .locals 3

    .prologue
    .line 52
    new-instance v0, Lcom/burstly/lib/component/IBurstlyAdaptorListener$FullscreenInfo;

    const-string v1, "greystripe"

    const/4 v2, 0x1

    invoke-direct {v0, v1, v2}, Lcom/burstly/lib/component/IBurstlyAdaptorListener$FullscreenInfo;-><init>(Ljava/lang/String;Z)V

    sput-object v0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->FULLSCREEN_INFO:Lcom/burstly/lib/component/IBurstlyAdaptorListener$FullscreenInfo;

    return-void
.end method

.method constructor <init>(Landroid/content/Context;Ljava/lang/String;)V
    .locals 2
    .parameter "context"
    .parameter "viewId"

    .prologue
    .line 156
    invoke-direct {p0, p1, p2}, Lcom/burstly/lib/component/AbstractAdaptor;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    .line 137
    new-instance v0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor$GSListener;

    invoke-direct {v0, p0}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor$GSListener;-><init>(Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;)V

    iput-object v0, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mListener:Lcom/greystripe/sdk/GSAdListener;

    .line 157
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, " GreystripeAdaptor"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mTag:Ljava/lang/String;

    .line 158
    new-instance v0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;

    invoke-direct {v0}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;-><init>()V

    iput-object v0, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mConfigurator:Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;

    .line 159
    return-void
.end method

.method static synthetic access$000(Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;)Ljava/lang/String;
    .locals 1
    .parameter "x0"

    .prologue
    .line 42
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mTag:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$100()Lcom/burstly/lib/util/LoggerExt;
    .locals 1

    .prologue
    .line 42
    sget-object v0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->LOG:Lcom/burstly/lib/util/LoggerExt;

    return-object v0
.end method

.method static synthetic access$200(Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;)Lcom/greystripe/sdk/GSFullscreenAd;
    .locals 1
    .parameter "x0"

    .prologue
    .line 42
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mPrecachedInterstitial:Lcom/greystripe/sdk/GSFullscreenAd;

    return-object v0
.end method

.method private wrap(Landroid/view/View;)Landroid/view/View;
    .locals 2
    .parameter "view"

    .prologue
    .line 173
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->getLayoutParamsResolver()Lcom/burstly/lib/component/LayoutParametersResolver;

    move-result-object v1

    invoke-virtual {v1}, Lcom/burstly/lib/component/LayoutParametersResolver;->resolveParameters()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v1

    invoke-virtual {p1, v1}, Landroid/view/View;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 174
    new-instance v0, Landroid/widget/RelativeLayout;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;)V

    .line 175
    .local v0, wrapper:Landroid/widget/RelativeLayout;
    const/16 v1, 0x11

    invoke-virtual {v0, v1}, Landroid/widget/RelativeLayout;->setGravity(I)V

    .line 176
    invoke-virtual {v0, p1}, Landroid/widget/RelativeLayout;->addView(Landroid/view/View;)V

    .line 177
    return-object v0
.end method


# virtual methods
.method protected checkParameters(Ljava/util/Map;)V
    .locals 2
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "*>;)V"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/IllegalArgumentException;
        }
    .end annotation

    .prologue
    .line 250
    .local p1, paramsFromServer:Ljava/util/Map;,"Ljava/util/Map<Ljava/lang/String;*>;"
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mConfigurator:Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;

    invoke-virtual {v0, p1}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;->initConfigurator(Ljava/util/Map;)V

    .line 251
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mConfigurator:Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;->updateLocation(Landroid/content/Context;)V

    .line 252
    return-void
.end method

.method public destroy()V
    .locals 1

    .prologue
    .line 261
    invoke-super {p0}, Lcom/burstly/lib/component/AbstractAdaptor;->destroy()V

    .line 262
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mPrecachedInterstitial:Lcom/greystripe/sdk/GSFullscreenAd;

    .line 263
    return-void
.end method

.method protected doGetNewAd()Landroid/view/View;
    .locals 13

    .prologue
    const/4 v7, 0x0

    .line 182
    iput-object v7, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mPrecachedInterstitial:Lcom/greystripe/sdk/GSFullscreenAd;

    .line 183
    iget-object v8, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mConfigurator:Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;

    invoke-virtual {v8}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;->getAppId()Ljava/lang/String;

    move-result-object v2

    .line 184
    .local v2, appId:Ljava/lang/String;
    sget-object v8, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->LOG:Lcom/burstly/lib/util/LoggerExt;

    iget-object v9, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mTag:Ljava/lang/String;

    const-string v10, "appID for Greystripe: {0}"

    const/4 v11, 0x1

    new-array v11, v11, [Ljava/lang/Object;

    const/4 v12, 0x0

    aput-object v2, v11, v12

    invoke-virtual {v8, v9, v10, v11}, Lcom/burstly/lib/util/LoggerExt;->logInfo(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 185
    iget-object v8, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mConfigurator:Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;

    invoke-virtual {v8}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;->getAdSize()Ljava/lang/String;

    move-result-object v1

    .line 186
    .local v1, adSize:Ljava/lang/String;
    const/4 v0, 0x0

    .line 187
    .local v0, ad:Lcom/greystripe/sdk/GSAd;
    const-string v8, "320x50"

    invoke-virtual {v8, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v8

    if-eqz v8, :cond_1

    .line 188
    new-instance v6, Lcom/greystripe/sdk/GSMobileBannerAdView;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->getContext()Landroid/content/Context;

    move-result-object v8

    invoke-direct {v6, v8, v2}, Lcom/greystripe/sdk/GSMobileBannerAdView;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    .line 189
    .local v6, mobileAd:Lcom/greystripe/sdk/GSMobileBannerAdView;
    iget-object v8, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mListener:Lcom/greystripe/sdk/GSAdListener;

    invoke-virtual {v6, v8}, Lcom/greystripe/sdk/GSMobileBannerAdView;->addListener(Lcom/greystripe/sdk/GSAdListener;)V

    .line 190
    invoke-virtual {v6}, Lcom/greystripe/sdk/GSMobileBannerAdView;->refresh()V

    .line 191
    move-object v0, v6

    .line 207
    .end local v6           #mobileAd:Lcom/greystripe/sdk/GSMobileBannerAdView;
    :goto_0
    if-eqz v0, :cond_0

    .line 208
    check-cast v0, Landroid/view/View;

    .end local v0           #ad:Lcom/greystripe/sdk/GSAd;
    invoke-direct {p0, v0}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->wrap(Landroid/view/View;)Landroid/view/View;

    move-result-object v7

    .line 210
    :cond_0
    return-object v7

    .line 192
    .restart local v0       #ad:Lcom/greystripe/sdk/GSAd;
    :cond_1
    const-string v8, "300x250"

    invoke-virtual {v8, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v8

    if-eqz v8, :cond_2

    .line 193
    new-instance v5, Lcom/greystripe/sdk/GSMediumRectangleAdView;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->getContext()Landroid/content/Context;

    move-result-object v8

    invoke-direct {v5, v8, v2}, Lcom/greystripe/sdk/GSMediumRectangleAdView;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    .line 194
    .local v5, mediumAd:Lcom/greystripe/sdk/GSMediumRectangleAdView;
    iget-object v8, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mListener:Lcom/greystripe/sdk/GSAdListener;

    invoke-virtual {v5, v8}, Lcom/greystripe/sdk/GSMediumRectangleAdView;->addListener(Lcom/greystripe/sdk/GSAdListener;)V

    .line 195
    invoke-virtual {v5}, Lcom/greystripe/sdk/GSMediumRectangleAdView;->refresh()V

    .line 196
    move-object v0, v5

    .line 197
    goto :goto_0

    .end local v5           #mediumAd:Lcom/greystripe/sdk/GSMediumRectangleAdView;
    :cond_2
    const-string v8, "728x90"

    invoke-virtual {v8, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v8

    if-eqz v8, :cond_3

    .line 198
    new-instance v4, Lcom/greystripe/sdk/GSLeaderboardAdView;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->getContext()Landroid/content/Context;

    move-result-object v8

    invoke-direct {v4, v8, v2}, Lcom/greystripe/sdk/GSLeaderboardAdView;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    .line 199
    .local v4, lederboardAd:Lcom/greystripe/sdk/GSLeaderboardAdView;
    iget-object v8, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mListener:Lcom/greystripe/sdk/GSAdListener;

    invoke-virtual {v4, v8}, Lcom/greystripe/sdk/GSLeaderboardAdView;->addListener(Lcom/greystripe/sdk/GSAdListener;)V

    .line 200
    invoke-virtual {v4}, Lcom/greystripe/sdk/GSLeaderboardAdView;->refresh()V

    .line 201
    move-object v0, v4

    .line 202
    goto :goto_0

    .line 203
    .end local v4           #lederboardAd:Lcom/greystripe/sdk/GSLeaderboardAdView;
    :cond_3
    new-instance v3, Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->getContext()Landroid/content/Context;

    move-result-object v8

    invoke-direct {v3, v8, v2}, Lcom/greystripe/sdk/GSFullscreenAd;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    .line 204
    .local v3, fullscreenAd:Lcom/greystripe/sdk/GSFullscreenAd;
    iget-object v8, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mListener:Lcom/greystripe/sdk/GSAdListener;

    invoke-virtual {v3, v8}, Lcom/greystripe/sdk/GSFullscreenAd;->addListener(Lcom/greystripe/sdk/GSAdListener;)V

    .line 205
    invoke-virtual {v3}, Lcom/greystripe/sdk/GSFullscreenAd;->fetch()V

    goto :goto_0
.end method

.method public getAdType()Lcom/burstly/lib/component/IBurstlyAdaptor$BurstlyAdType;
    .locals 1

    .prologue
    .line 256
    iget-object v0, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mConfigurator:Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;

    invoke-virtual {v0}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;->isInterstitial()Z

    move-result v0

    if-eqz v0, :cond_0

    sget-object v0, Lcom/burstly/lib/component/IBurstlyAdaptor$BurstlyAdType;->INTERSTITIAL_AD_TYPE:Lcom/burstly/lib/component/IBurstlyAdaptor$BurstlyAdType;

    :goto_0
    return-object v0

    :cond_0
    sget-object v0, Lcom/burstly/lib/component/IBurstlyAdaptor$BurstlyAdType;->BANNER_AD_TYPE:Lcom/burstly/lib/component/IBurstlyAdaptor$BurstlyAdType;

    goto :goto_0
.end method

.method public getNetworkName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 240
    const-string v0, "greystripe"

    return-object v0
.end method

.method public precacheAd()Landroid/view/View;
    .locals 1

    .prologue
    .line 215
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->getNewAd()Landroid/view/View;

    move-result-object v0

    return-object v0
.end method

.method public precacheInterstitialAd()V
    .locals 6

    .prologue
    .line 220
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mConfigurator:Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;

    invoke-virtual {v1}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeConfigurator;->getAppId()Ljava/lang/String;

    move-result-object v0

    .line 221
    .local v0, appId:Ljava/lang/String;
    sget-object v1, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->LOG:Lcom/burstly/lib/util/LoggerExt;

    iget-object v2, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mTag:Ljava/lang/String;

    const-string v3, "pubID for Greystripe: {0}"

    const/4 v4, 0x1

    new-array v4, v4, [Ljava/lang/Object;

    const/4 v5, 0x0

    aput-object v0, v4, v5

    invoke-virtual {v1, v2, v3, v4}, Lcom/burstly/lib/util/LoggerExt;->logInfo(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    .line 222
    new-instance v1, Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-direct {v1, v2, v0}, Lcom/greystripe/sdk/GSFullscreenAd;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    iput-object v1, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mPrecachedInterstitial:Lcom/greystripe/sdk/GSFullscreenAd;

    .line 223
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mPrecachedInterstitial:Lcom/greystripe/sdk/GSFullscreenAd;

    iget-object v2, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mListener:Lcom/greystripe/sdk/GSAdListener;

    invoke-virtual {v1, v2}, Lcom/greystripe/sdk/GSFullscreenAd;->addListener(Lcom/greystripe/sdk/GSAdListener;)V

    .line 224
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mPrecachedInterstitial:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {v1}, Lcom/greystripe/sdk/GSFullscreenAd;->fetch()V

    .line 225
    return-void
.end method

.method public showPrecachedInterstitialAd()V
    .locals 3

    .prologue
    .line 229
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mPrecachedInterstitial:Lcom/greystripe/sdk/GSFullscreenAd;

    if-eqz v1, :cond_0

    .line 230
    invoke-virtual {p0}, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->getAdaptorListener()Lcom/burstly/lib/component/IBurstlyAdaptorListener;

    move-result-object v0

    .line 231
    .local v0, adaptorListener:Lcom/burstly/lib/component/IBurstlyAdaptorListener;
    const-string v1, "greystripe"

    const/4 v2, 0x1

    invoke-interface {v0, v1, v2}, Lcom/burstly/lib/component/IBurstlyAdaptorListener;->didLoad(Ljava/lang/String;Z)V

    .line 232
    sget-object v1, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->FULLSCREEN_INFO:Lcom/burstly/lib/component/IBurstlyAdaptorListener$FullscreenInfo;

    invoke-interface {v0, v1}, Lcom/burstly/lib/component/IBurstlyAdaptorListener;->shownFullscreen(Lcom/burstly/lib/component/IBurstlyAdaptorListener$FullscreenInfo;)V

    .line 233
    iget-object v1, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mPrecachedInterstitial:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {v1}, Lcom/greystripe/sdk/GSFullscreenAd;->display()V

    .line 234
    const/4 v1, 0x0

    iput-object v1, p0, Lcom/burstly/lib/component/networkcomponent/greystripe/GreystripeAdaptor;->mPrecachedInterstitial:Lcom/greystripe/sdk/GSFullscreenAd;

    .line 236
    .end local v0           #adaptorListener:Lcom/burstly/lib/component/IBurstlyAdaptorListener;
    :cond_0
    return-void
.end method

.method public supports(Ljava/lang/String;)Z
    .locals 1
    .parameter "action"

    .prologue
    .line 245
    const/4 v0, 0x1

    return v0
.end method
